<template>
  <view class="container">
    <image
      class="header_img"
      src="/static/img/enterpriseServer/index_header.png"
      mode="scaleToFill"
    />
    <view class="header">
      <view class="header_top">
        <view class="header_title">企服商家</view>
        <view class="header_server" @click="become()">成为服务商</view>
      </view>
      <view class="header_dsc">跨区域工商财税交易就用企服商家</view>

      <view class="header_btns">
        <view
          class="btn"
          @click="server(1, '/enterpriseServer/publishDemand/index')"
        >
          <view class="btn_top">
            发布需求
            <u-icon
              class="btn_arrow"
              name="arrow-right"
              color="#fff"
              size="12"
            ></u-icon>
          </view>
          <view class="btn_dsc">免费发布需求</view>
        </view>
        <view
          class="btn"
          @click="server(2, '/enterpriseServer/service/index?index=1')"
        >
          <view class="btn_top">
            找服务商
            <u-icon
              class="btn_arrow"
              name="arrow-right"
              color="#fff"
              size="12"
            ></u-icon>
          </view>
          <view class="btn_dsc">网点多，分布广</view>
        </view>
      </view>
    </view>

    <view class="demand">
      <view class="demand_top">
        <view class="top_title">最新需求</view>
        <view
          class="top_more"
          @click="more(1, '/enterpriseServer/demandHall/index')"
        >
          更多
          <u-icon name="arrow-right" color="#333" size="14"></u-icon>
        </view>
      </view>

      <view class="demand_list">
        <view
          class="li"
          v-for="(item, index) in demandList"
          :key="index"
          @click="goTo(1, item, '/enterpriseServer/demandDetails/index')"
        >
          <view class="li_top">
            <view class="top_info">
              <view class="info_title">{{ item.name }}</view>
              <view class="info_tag">{{
                item.money == 0 ? "面议" : "¥" + item.money
              }}</view>
            </view>
            <view class="top_dsc">描述：{{ item.describe }}</view>
          </view>

          <view class="li_bottom">
            <view class="address">{{ item.city_name }}</view>
            <view class="taking"
              >去接单
              <u-icon name="arrow-right" color="#0068ff" size="14"></u-icon>
            </view>
          </view>
        </view>
      </view>
    </view>

    <view class="server">
      <view class="server_top">
        <view class="tabs">
          <u-tabs
            :list="tabList"
            @click="tabToggle"
            :current="tabIndex"
            lineWidth="60rpx"
          ></u-tabs>
        </view>
        <view
          class="top_more"
          @click="more(2, '/enterpriseServer/service/index')"
        >
          更多
          <u-icon name="arrow-right" color="#333" size="14"></u-icon>
        </view>
      </view>

      <!-- 精选服务 -->
      <view v-if="tabIndex == 1" class="server_list">
        <view
          class="server_item"
          v-for="(item, index) in shopList"
          :key="index"
          @click="goTo(2, item, '/enterpriseServer/productInfo/index')"
        >
          <image class="item_left" :src="item.pic" mode="scaleToFill" />
          <view class="item_right">
            <view class="right_title ellipsis1">{{ item.name }}</view>
            <view class="right_tips ellipsis1">{{
              item.price == 0 ? "面议" : "¥" + item.price
            }}</view>
            <view class="right_details ellipsis1"
              >{{ item.serviceinfo.city }}丨{{ item.serviceinfo.name }}</view
            >
          </view>
        </view>
        <view class="server_item" v-if="shopList.length == 0">
          <view class="empty_wrap">暂无数据</view>
        </view>
      </view>
      <!-- 推荐服务商 -->
      <view v-if="tabIndex == 0" class="server_list">
        <view
          class="server_item"
          v-for="(item, index) in serviceList"
          :key="index"
          @click="goTo(2, item, '/enterpriseServer/merchantInfo/index')"
        >
          <image class="item_left" :src="item.logo" mode="scaleToFill" />
          <view class="item_right item_right1">
            <view class="right_top">
              <view class="tag" v-if="item.type == 1">官方</view>
              <view class="right_title ellipsis1">{{ item.name }}</view>
            </view>
            <view
              class="right_server_tips ellipsis1"
              v-if="item.good_services.length > 0"
              >擅长服务：{{ item.good_services.join("、") }}</view
            >
            <view class="right_details">
              <u-icon name="map" color="#666" size="13"></u-icon>
              {{ item.city }}
            </view>
          </view>
        </view>
        <view class="server_item" v-if="serviceList.length == 0">
          <view class="empty_wrap">暂无数据</view>
        </view>
      </view>
    </view>
  </view>
</template>

<script
  type="text/javascript"
  src="plus-confusion://../enterpriseServer/index/index"
></script>

<style lang="scss" scoped>
@import "index.scss";
</style>
